import { FontUtil } from "../../../../common/font/FontUtil";
import { ColorConfig } from "../../../resource/ColorConfig";
import { ItemData } from "../../../resource/info/ItemData";
import { SPetInfo } from "../../../../../Message/Game/SPetInfo";
import { PetColor } from "../../pet/info/PetColor";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { ChatType } from "../chatViewData/ChatType";
type int = number;
//class ChatStyle
    
    export  class ChatStyle
    {
        

        /* internal  */static createElementFormat(): Object /* flash.text.engine.ElementFormat */
        {
            var loc1=new Object /* flash.text.engine.ElementFormat */();
            return loc1;
        }

        public static getTitleFormat(arg1: string): Object /* flash.text.engine.ElementFormat */
        {
            var loc1=new Object /* flash.text.engine.FontDescription */();
            loc1.fontName = FontUtil.songtiName;
            var loc2=ChatStyle.createElementFormat();
            loc2.color = ChatStyle.getTitleColor(arg1);
            loc2.baselineShift = 0;
            loc2.fontDescription = loc1;
            loc2.trackingRight = 1;
            return loc2;
        }

        public static getCampFormat(arg1: int, arg2: int=12): Object /* flash.text.engine.ElementFormat */
        {
            var loc1=ChatStyle.createElementFormat();
            loc1.color = ChatStyle.getCampColor(arg1);
            var loc2;
            (loc2 = new Object /* flash.text.engine.FontDescription */()).fontName = FontUtil.songtiName;
            loc1.baselineShift = 0;
            loc1.fontDescription = loc2;
            loc1.trackingLeft = 1;
            loc1.fontSize = arg2;
            return loc1;
        }

        public static getPlayerNameFormat(arg1: int=8191487, arg2: int=12): Object /* flash.text.engine.ElementFormat */
        {
            var loc1=new Object /* flash.text.engine.FontDescription */();
            loc1.fontName = FontUtil.songtiName;
            var loc2;
            (loc2 = ChatStyle.createElementFormat()).fontDescription = loc1;
            loc2.breakOpportunity = flash.text.engine.BreakOpportunity.ANY;
            loc2.baselineShift = 0;
            loc2.color = arg1;
            loc2.trackingLeft = 1;
            loc2.fontSize = arg2;
            return loc2;
        }

        public static getRumorPlayerNameFormat(arg1: int=8191487, arg2: int=12): Object /* flash.text.engine.ElementFormat */
        {
            var loc1=new Object /* flash.text.engine.FontDescription */();
            loc1.fontName = FontUtil.songtiName;
            var loc2;
            (loc2 = ChatStyle.createElementFormat()).fontDescription = loc1;
            loc2.breakOpportunity = flash.text.engine.BreakOpportunity.ANY;
            loc2.baselineShift = 5;
            loc2.color = arg1;
            loc2.trackingLeft = 1;
            loc2.fontSize = arg2;
            return loc2;
        }

        public static getFaceFormat(arg1: int=12): Object /* flash.text.engine.ElementFormat */
        {
            var loc1=new Object /* flash.text.engine.FontDescription */();
            loc1.fontName = FontUtil.songtiName;
            var loc2=ChatStyle.createElementFormat();
            loc2.fontDescription = loc1;
            loc2.baselineShift = 7;
            loc2.fontSize = arg1;
            return loc2;
        }

        public static getVIPFaceFormat(arg1: int=12): Object /* flash.text.engine.ElementFormat */
        {
            var loc1=new Object /* flash.text.engine.FontDescription */();
            loc1.fontName = FontUtil.songtiName;
            var loc2=ChatStyle.createElementFormat();
            loc2.fontDescription = loc1;
            loc2.baselineShift = 2;
            loc2.fontSize = arg1;
            return loc2;
        }

        public static getLinkFormat(arg1: int=12): Object /* flash.text.engine.ElementFormat */
        {
            var loc1=new Object /* flash.text.engine.FontDescription */();
            loc1.fontName = FontUtil.songtiName;
            var loc2=ChatStyle.createElementFormat();
            loc2.breakOpportunity = flash.text.engine.BreakOpportunity.ANY;
            loc2.fontDescription = loc1;
            loc2.color = 16711680;
            loc2.baselineShift = 5;
            loc2.trackingLeft = 1;
            loc2.fontSize = arg1;
            return loc2;
        }

        public static getRumorLink(arg1: int=12): Object /* flash.text.engine.ElementFormat */
        {
            var loc1=new Object /* flash.text.engine.FontDescription */();
            loc1.fontName = FontUtil.songtiName;
            var loc2=ChatStyle.createElementFormat();
            loc2.breakOpportunity = flash.text.engine.BreakOpportunity.ANY;
            loc2.fontDescription = loc1;
            loc2.color = ColorConfig.instance.getRumorColor(2).intColor;
            loc2.baselineShift = 5;
            loc2.trackingLeft = 1;
            loc2.fontSize = arg1;
            return loc2;
        }

        public static getImageFormat(arg1: int=2, arg2: int=12): Object /* flash.text.engine.ElementFormat */
        {
            var loc1=new Object /* flash.text.engine.FontDescription */();
            loc1.fontName = FontUtil.songtiName;
            var loc2;
            (loc2 = ChatStyle.createElementFormat()).fontDescription = loc1;
            loc2.baselineShift = arg1;
            loc2.fontSize = arg2;
            return loc2;
        }

        public static getRumorEquipmentFormat(arg1: ItemData, arg2: int=12): Object /* flash.text.engine.ElementFormat */
        {
            var loc3=null;
            var loc1=new Object /* flash.text.engine.FontDescription */();
            loc1.fontName = FontUtil.songtiName;
            var loc2;
            (loc2 = ChatStyle.createElementFormat()).fontDescription = loc1;
            loc2.baselineShift = 5;
            loc2.fontSize = arg2;
            if (arg1.itemInfo) 
            {
                if (loc3 = ColorConfig.instance.getItemColor(arg1.itemInfo.item.color)) 
                {
                    loc2.color = loc3.intColor;
                }
            }
            loc2.trackingLeft = 1;
            return loc2;
        }

        public static getEquipmentFormat(arg1: ItemData, arg2: int=12): Object /* flash.text.engine.ElementFormat */
        {
            var loc1=new Object /* flash.text.engine.FontDescription */();
            loc1.fontName = FontUtil.songtiName;
            var loc2;
            (loc2 = ChatStyle.createElementFormat()).fontDescription = loc1;
            loc2.baselineShift = 0;
            loc2.color = ColorConfig.instance.getItemColor(arg1.itemInfo.item.color).intColor;
            loc2.trackingLeft = 1;
            loc2.fontSize = arg2;
            return loc2;
        }

        public static getPetFormat(arg1: SPetInfo, arg2: int=12): Object /* flash.text.engine.ElementFormat */
        {
            var loc1=new Object /* flash.text.engine.FontDescription */();
            loc1.fontName = FontUtil.songtiName;
            var loc2;
            (loc2 = ChatStyle.createElementFormat()).fontDescription = loc1;
            loc2.baselineShift = 0;
            loc2.color = PetColor.getTalentColor(arg1).intColor;
            loc2.trackingLeft = 1;
            loc2.fontSize = arg2;
            return loc2;
        }

        public static getGMFormat(arg1: int=12): Object /* flash.text.engine.ElementFormat */
        {
            var loc1=new Object /* flash.text.engine.FontDescription */();
            loc1.fontName = FontUtil.songtiName;
            var loc2=ChatStyle.createElementFormat();
            loc2.breakOpportunity = flash.text.engine.BreakOpportunity.ANY;
            loc2.fontDescription = loc1;
            loc2.baselineShift = 0;
            loc2.color = GlobalStyle.color2Uint;
            loc2.trackingLeft = 2;
            loc2.fontSize = arg1;
            return loc2;
        }

        public static getGuideFormat(): Object /* flash.text.engine.ElementFormat */
        {
            var loc1=new Object /* flash.text.engine.FontDescription */();
            loc1.fontName = FontUtil.songtiName;
            var loc2=ChatStyle.createElementFormat();
            loc2.breakOpportunity = flash.text.engine.BreakOpportunity.ANY;
            loc2.fontDescription = loc1;
            loc2.baselineShift = 0;
            loc2.color = GlobalStyle.color2Uint;
            loc2.trackingLeft = 2;
            return loc2;
        }

        public static getContentFormat(arg1: int=8584191, arg2: int=12): Object /* flash.text.engine.ElementFormat */
        {
            var loc1=new Object /* flash.text.engine.FontDescription */();
            loc1.fontName = FontUtil.songtiName;
            var loc2;
            (loc2 = ChatStyle.createElementFormat()).breakOpportunity = flash.text.engine.BreakOpportunity.ANY;
            loc2.fontDescription = loc1;
            loc2.baselineShift = 0;
            loc2.fontSize = arg2;
            loc2.color = arg1;
            loc2.trackingLeft = 2;
            return loc2;
        }

        public static getBRFormat(): Object /* flash.text.engine.ElementFormat */
        {
            var loc1=new Object /* flash.text.engine.FontDescription */();
            loc1.fontName = FontUtil.songtiName;
            var loc2=ChatStyle.createElementFormat();
            loc2.breakOpportunity = flash.text.engine.BreakOpportunity.ALL;
            loc2.fontDescription = loc1;
            loc2.baselineShift = 0;
            loc2.trackingLeft = 2;
            return loc2;
        }

        public static getDiceColor(): int
        {
            return ColorConfig.instance.getChatColor("System").intColor;
        }

        public static getTitleColor(arg1: string): int
        {
            var loc2=null;
            var loc1=16075338;
            var loc3=arg1;
            switch (loc3) 
            {
                case ChatType.System:
                {
                    loc2 = ColorConfig.instance.getChatColor("System");
                    break;
                }
                case ChatType.Tips:
                {
                    loc2 = ColorConfig.instance.getChatColor("Tips");
                    break;
                }
                case ChatType.Legent:
                {
                    loc2 = ColorConfig.instance.getChatColor("Legent");
                    break;
                }
                case ChatType.Battlefield:
                {
                    loc2 = ColorConfig.instance.getChatColor("Battlefield");
                    break;
                }
                case ChatType.World:
                {
                    loc2 = ColorConfig.instance.getChatColor("World");
                    break;
                }
                case ChatType.Scene:
                {
                    loc2 = ColorConfig.instance.getChatColor("Scene");
                    break;
                }
                case ChatType.State:
                {
                    loc2 = ColorConfig.instance.getChatColor("State");
                    break;
                }
                case ChatType.Union:
                {
                    loc2 = ColorConfig.instance.getChatColor("Union");
                    break;
                }
                case ChatType.Team: case ChatType.CrossGroup:
                {
                    loc2 = ColorConfig.instance.getChatColor("Team");
                    break;
                }
                case ChatType.Speaker:
                {
                    loc2 = ColorConfig.instance.getChatColor("Speaker");
                    break;
                }
                case ChatType.Force:
                {
                    loc2 = ColorConfig.instance.getChatColor("Force");
                    break;
                }
                case ChatType.CrossServer:
                {
                    loc2 = ColorConfig.instance.getChatColor("CrossServer");
                    break;
                }
                case ChatType.GuildUnion:
                {
                    loc2 = ColorConfig.instance.getChatColor("GuildUnion");
                    break;
                }
            }
            if (loc2) 
            {
                loc1 = loc2.intColor;
            }
            return loc1;
        }

        public static getChatContentColor(): int
        {
            var loc2=null;
            var loc1=8191487;
            loc2 = ColorConfig.instance.getChatColor("ChatContent");
            if (loc2) 
            {
                loc1 = loc2.intColor;
            }
            return loc1;
        }

        public static getCampColor(arg1: int): int
        {
            return ColorConfig.instance.getCountryColor(arg1).intColor;
        }
    }
